import request from '@/utils/request'

// 查询设备网关列表
export function listDeviceGateway(query) {
  return request({
    url: '/iot/device-gateway/list',
    method: 'get',
    params: query
  })
}

// 查询指定设备网关
export function getDeviceGateway(ids) {
  return request({
    url: '/iot/device-gateway/'+ids,
    method: 'get',
  })
}


// 新增设备网关
export function addDeviceGateway(data) {
  return request({
    url: '/iot/device-gateway',
    method: 'post',
    data: data
  })
}

// 修改设备网关
export function editDeviceGateway(data) {
  return request({
    url: '/iot/device-gateway',
    method: 'put',
    data: data
  })
}

// 删除设备网关
export function removeDeviceGateway(id) {
  return request({
    url: '/iot/device-gateway/' + id,
    method: 'delete'
  })
}

// 启动设备网关
export function startupDeviceGateway(id) {
  return request({
    url: '/iot/device-gateway/startup/' + id,
    method: 'post'
  })
}

// 停止设备网关
export function shutdownDeviceGateway(id) {
  return request({
    url: '/iot/device-gateway/shutdown/' + id,
    method: 'delete'
  })
}

// 获取支持的设备网关
export function getProviders() {
  return request({
    url: '/iot/device-gateway/providers',
    method: 'get'
  })
}
